package com.ces.knacky.model;

import java.io.Serializable;

import org.apache.commons.lang.builder.EqualsBuilder;

import com.ces.knacky.framework.model.AbstractChildEntity;

/** @author Hibernate CodeGenerator */
public class UserRole extends AbstractChildEntity implements Serializable {

    /** persistent field */
    private com.ces.knacky.model.RoleTable role;

    /** persistent field */
    private com.ces.knacky.model.UserTable user;

    /** full constructor */
    public UserRole(com.ces.knacky.model.RoleTable role, com.ces.knacky.model.Flag flag, com.ces.knacky.model.UserTable user) {
        this.role = role;
        this.flag = flag;
        this.user = user;
    }

    /** default constructor */
    public UserRole() {
    }

    public com.ces.knacky.model.RoleTable getRole() {
        return this.role;
    }

    public void setRole(com.ces.knacky.model.RoleTable role) {
        this.role = role;
    }

    public com.ces.knacky.model.UserTable getUser() {
        return this.user;
    }

    public void setUser(com.ces.knacky.model.UserTable user) {
        this.user = user;
    }

    public boolean equals(Object other) {
        if ( !(other instanceof UserRole) ) return false;
        UserRole castOther = (UserRole) other;
        return new EqualsBuilder()
            .append(this.getId(), castOther.getId())
            .isEquals();
    }

}
